<template>
  <div class="error-container">
    <div class="error-box">
      <div class="error-icon">⚠️</div>
      <h2>登录失败</h2>
      <p>邮箱或密码错误，请重新尝试登录。</p>
      <div class="error-actions">
        <button @click="goToLogin" class="retry-btn">重新登录</button>
        <button @click="goToRegister" class="register-btn">立即注册</button>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { useRouter } from 'vue-router';

const router = useRouter();

const goToLogin = () => {
  router.push('/login');
};

const goToRegister = () => {
  router.push('/login?register=true');
};
</script>

<style scoped>
.error-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 20px;
}

.error-box {
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  padding: 40px;
  text-align: center;
  max-width: 400px;
  width: 100%;
}

.error-icon {
  font-size: 48px;
  margin-bottom: 20px;
}

.error-box h2 {
  color: #f44336;
  margin-bottom: 20px;
  font-size: 28px;
}

.error-box p {
  color: #666;
  font-size: 16px;
  margin-bottom: 30px;
  line-height: 1.6;
}

.error-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
}

.retry-btn, .register-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.retry-btn {
  background-color: #42b983;
  color: white;
}

.retry-btn:hover {
  background-color: #359469;
  transform: translateY(-2px);
}

.register-btn {
  background-color: #2196f3;
  color: white;
}

.register-btn:hover {
  background-color: #0b7dda;
  transform: translateY(-2px);
}

@media (max-width: 480px) {
  .error-actions {
    flex-direction: column;
  }
  
  .retry-btn, .register-btn {
    width: 100%;
  }
}
</style>